package com.ruoyi.yanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yanjing.mapper.MonitorPointMapper;
import com.ruoyi.yanjing.domain.MonitorPoint;
import com.ruoyi.yanjing.service.IMonitorPointService;

/**
 * 监测点位信息Service业务层处理
 * 
 * @author whz
 * @date 2024-11-18
 */
@Service
public class MonitorPointServiceImpl implements IMonitorPointService 
{
    @Autowired
    private MonitorPointMapper monitorPointMapper;

    /**
     * 查询监测点位信息
     * 
     * @param id 监测点位信息主键
     * @return 监测点位信息
     */
    @Override
    public MonitorPoint selectMonitorPointById(String id)
    {
        return monitorPointMapper.selectMonitorPointById(id);
    }

    /**
     * 查询监测点位信息列表
     * 
     * @param monitorPoint 监测点位信息
     * @return 监测点位信息
     */
    @Override
    public List<MonitorPoint> selectMonitorPointList(MonitorPoint monitorPoint)
    {
        return monitorPointMapper.selectMonitorPointList(monitorPoint);
    }
    @Override
    public List<MonitorPoint> selectAllPointDeviceList(MonitorPoint monitorPoint)
    {
        return monitorPointMapper.selectAllPointDeviceList(monitorPoint);
    }

    /**
     * 查询监测点位线路电杆信息列表
     *
     * @param monitorPoint 监测点位信息
     * @return 监测点位信息
     */
    @Override
    public List<MonitorPoint> selectMonitorPointAndLinePoleInfoList(MonitorPoint monitorPoint)
    {
        return monitorPointMapper.selectMonitorPointAndLinePoleInfoList(monitorPoint);
    }

    /**
     * 查询异常监测点位线路电杆信息列表
     *
     * @param monitorPoint 监测点位信息
     * @return 监测点位信息
     */
    @Override
    public List<MonitorPoint> selectAbnormalMonitorPointAndLinePoleInfoList(MonitorPoint monitorPoint)
    {
        monitorPoint.setPointAlarmStatus("0");
        return monitorPointMapper.selectAbnormalMonitorPointAndLinePoleInfoList(monitorPoint);
    }

    /**
     * 查询所有的监测点位线路电杆信息列表通过点位编码和网关id
     *
     * @param monitorPoint 监测点位信息
     * @return 监测点位信息
     */
    @Override
    public List<MonitorPoint> selecAllMonitorPointAndLinePoleInfoList(MonitorPoint monitorPoint)
    {
        return monitorPointMapper.selecAllMonitorPointAndLinePoleInfoList(monitorPoint);
    }



    /**
     * 新增监测点位信息
     * 
     * @param monitorPoint 监测点位信息
     * @return 结果
     */
    @Override
    public int insertMonitorPoint(MonitorPoint monitorPoint)
    {
        monitorPoint.setCreateTime(DateUtils.getNowDate());
        return monitorPointMapper.insertMonitorPoint(monitorPoint);
    }

    /**
     * 修改监测点位信息
     * 
     * @param monitorPoint 监测点位信息
     * @return 结果
     */
    @Override
    public int updateMonitorPoint(MonitorPoint monitorPoint)
    {
        monitorPoint.setUpdateTime(DateUtils.getNowDate());
        return monitorPointMapper.updateMonitorPoint(monitorPoint);
    }

    /**
     * 批量删除监测点位信息
     * 
     * @param ids 需要删除的监测点位信息主键
     * @return 结果
     */
    @Override
    public int deleteMonitorPointByIds(String[] ids)
    {
        return monitorPointMapper.deleteMonitorPointByIds(ids);
    }

    /**
     * 删除监测点位信息信息
     * 
     * @param id 监测点位信息主键
     * @return 结果
     */
    @Override
    public int deleteMonitorPointById(String id)
    {
        return monitorPointMapper.deleteMonitorPointById(id);
    }
}
